#!/usr/bin/env node

// 06-listen-radio.js
const Radio = require('./06-radio');

const station = {
  freq: '101.5',
  name: 'Jazz Radio'
};

const radio = new Radio(station);

// 监听 play 事件
radio.on('play', function(station) {
  console.log('Radio is now playing:', station.name, station.freq);
});

// 监听 stop 事件
radio.on('stop', function(station) {
  console.log('Radio has stopped playing:', station.name, station.freq);
});